<?php
$MainMenu = Dracosys::getMainMenu();
foreach($MainMenu->getArMenus() as $Menu):
    if( !$Menu->hasSubmenu() ):
        continue;
    endif;

    echo '
        <div id="DrSub'.$Menu->getStId().'" class="hide">
            <p class="menu_head left">'.$Menu->getStNome().'</p>
            <div class="menu_body">
    ';

    foreach( $Menu->getArSubmenus() as $SubMenu ):
        if( $SubMenu->isGroup() ):
            if( !$SubMenu->hasSubItens() ) { continue; }
            echo '  <p class="submenu_head left">'.$SubMenu->getStNome().'</p>
                    <div class="submenu_body">
            ';

            foreach( $SubMenu->getArSubItens() as $SubItem ):
                echo '<a href="'.$SubItem->getStUrl().'">'.$SubItem->getStNome().'</a>';
            endforeach;

            echo '  </div>';

        else:
             echo '<a href="'.$SubMenu->getStUrl().'">'.$SubMenu->getStNome().'</a>';
        endif;
    endforeach;

    echo '</div>
        </div>
    ';
endforeach;
?>